package error_checking;

public abstract class ErrorChecker {
	
	private boolean hasError;
	private String error;
	
	public ErrorChecker(){
		setErrorFalse();
	}
	
	public void setHasError(boolean newError){
		hasError = newError;
	}
	
	public void setErrorMsg(String newMsg){
		error = newMsg;
	}
	
	public void setErrorTrue(String newMsg){
		hasError = true;
		error = newMsg;
	}
	
	public void setErrorFalse(){
		hasError = false;
		clearErrorMsg();
	}
	
	public void clearErrorMsg(){
		error = "";
	}
	
	public boolean hasError(){
		return hasError;
	}
	
	public String getErrorText(){
		return error;
	}

}
